home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Limit on #bytes inside of struct?
- Date: Fri, 09 Feb 96 13:45:13 GMT
- Organization: none
- Message-ID: <823873513snz@genesis.demon.co.uk>
- References: <4feg1d$d4g@cville-srv.wam.umd.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4feg1d$d4g@cville-srv.wam.umd.edu>
- jsquires@wam.umd.edu "jeffrey d squires" writes:
-
- >I have the following:
- >
- >typedef struct {
- > int zero;
- > int one;
- > int two;
- > int three;
- > int four;
- > int five;
- > int six;
- > int seven_or_more;
- >} hist_type;
-
- Just a thought (not really relevant to your question) but this looks like
- it may be better built from an array.
-
- >
- >hist_type histogram;
- >int num=2;
- >
- >histogram.zero = 0;
- >histogram.one = 0;
- >histogram.two = 0;
- >histogram.three = 0;
- >histogram.four = 0; /* at this point, value of num changes from 2 to 0!!!*/
-
- How can you tell?
-
- >Is there a limit on the number of bytes allowed inside of a struct?
-
- Possibly but that isn't an issue here.
-
- >I am positive that the value of num changes from 2 before the last
- >assignment to 0 after it. Any ideas?
-
- Post a complete program that goes wrong. The problem is almost certainly
- in part of the code you haven't posted here.
-
- > Is this a bug in gcc? Unix?
-
- Possible but very unlikely.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-